<template>
  <div>
    <!-- 事件 -->
    <div v-if="formKey==='EVENTDJFF'">
      <IncidentRegistration v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <IncidentRegistrationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='EVENTZP'">
      <IncidentAppoint v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <IncidentAppointView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='EVENTGB'">
      <IncidentClose v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <IncidentCloseView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='EVENTQR'">
      <IncidentConfirm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <IncidentConfirmView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='EVENTCL'">
      <IncidentHandle v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <IncidentHandleView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 问题 -->
    <div v-if="formKey==='PROBLEMDJFF'">
      <ProblemRegistration v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ProblemRegistrationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='PROBLEMZP'">
      <ProblemAssignment v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ProblemAssignmentView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='PROBLEMGB'">
      <ProblemClosing v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ProblemClosingView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='PROBLEMQR'">
      <ProblemConfirmation v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ProblemConfirmationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='PROBLEMCL'">
      <ProblemHandling v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ProblemHandlingView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 变更 -->
    <div v-if="formKey==='CHANGEDJFF'">
      <ChangeRegistration v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeRegistrationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEZP'">
      <ChangeAssignment v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeAssignmentView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEJH'">
      <ChangePlan v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangePlanView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEYJSP'">
      <ChangeApproval v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeApprovalView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEEJSP'">
      <ChangeApproval v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeApprovalView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGESS'">
      <ChangeImplementation v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeImplementationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEQR'">
      <ChangeConfirmation v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeConfirmationView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey==='CHANGEGB'">
      <ChangeClosing v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <ChangeClosingView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 故障 -->
    <!-- 故障创建表单 -->
    <div v-if="formKey==='MALFUNCTIONAPPLYFORM'">
      <MalfunctionApplyForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <MalfunctionApplyViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 一线工程师处理 -->
    <div v-if="formKey==='MALFUNCTIONFIRSTLINEHANDLE'">
      <MalfunctionFrontlineProcessingForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <MalfunctionFrontlineProcessingViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 运维组长确认 -->
    <div v-if="formKey==='MALFUNCTIONLEADERAPPROVALFORM'">
      <LeaderApprovalForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <LeaderApprovalViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 二线组长确认 -->
    <div v-if="formKey==='MALFUNCTIONSECONDLEADERAPPROVALFORM'">
      <SecondLeaderForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SecondLeaderViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 二线工程师处理 -->
    <div v-if="formKey==='MALFUNCTIONSECONDLINEFORM'">
      <SecondLineHandleForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" :form-flag="false" v-on="$listeners" />
      <SecondLineHandleViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" :form-flag="false" v-on="$listeners" />
    </div>
    <!-- 转派二线工程师处理 -->
    <div v-if="formKey==='MALFUNCTIONSTRANSFERECONDLINEFORM'">
      <SecondLineHandleForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" :form-flag="true" v-on="$listeners" />
      <SecondLineHandleViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" :form-flag="true" v-on="$listeners" />
    </div>
    <!-- 领导会签节点 -->
    <div v-if="formKey==='MALFUNCTIONHIGHLEVELCONFIRMATION'">
      <CountersignatureForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <CountersignatureViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 一线工程师导入客户评价和反馈 -->
    <div v-if="formKey==='MALFUNCTIONCUSTOMERREVIEWFORM'">
      <CustomerReviewForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <CustomerReviewViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>

    <!-- 备品备件领用 -->
    <div v-if="formKey==='spareApply'">
      <SpareConsumeApply v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SpareConsumeApplyView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey=== 'spareGroupLeaderApprove'">
      <SpareConsumeGLeaderApprove v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SpareConsumeGLeaderApproveView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey === 'sparePMApprove'">
      <SpareConsumePMApprove v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SpareConsumePMApproveView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey === 'spareManagerConfirm'">
      <SpareConsumeConfirm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SpareConsumeConfirmView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <div v-if="formKey === 'spareManageCollect'">
      <SpareConsumeCollect v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <SpareConsumeCollectView v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>

    <!-- 变更 -->
    <!-- 变更创建表单 -->
    <div v-if="formKey==='ALTERAPPLYFORM'">
      <AlterApplyForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterApplyViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 一线工程师处理 -->
    <div v-if="formKey==='ALTERFIRSTLINEHANDLE'">
      <AlterFrontlineProcessingForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterFrontlineProcessingViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 运维组长确认 -->
    <div v-if="formKey==='ALTERLEADERAPPROVALFORM'">
      <AlterLeaderApprovalForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterLeaderApprovalViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 二线组长确认 -->
    <div v-if="formKey==='ALTERSECONDLEADERAPPROVALFORM'">
      <AlterSecondLeaderForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterSecondLeaderViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 二线工程师处理 -->
    <div v-if="formKey==='ALTERSECONDLINEFORM'">
      <AlterSecondLineHandleForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" :form-flag="false" v-on="$listeners" />
      <AlterSecondLineHandleViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" :form-flag="false" v-on="$listeners" />
    </div>
    <!-- 转派二线工程师处理 -->
    <div v-if="formKey==='ALTERSTRANSFERECONDLINEFORM'">
      <AlterSecondLineHandleForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" :form-flag="true" v-on="$listeners" />
      <AlterSecondLineHandleViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" :form-flag="true" v-on="$listeners" />
    </div>
    <!-- 领导会签节点 -->
    <div v-if="formKey==='ALTERHIGHLEVELCONFIRMATION'">
      <AlterCountersignatureForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterCountersignatureViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>
    <!-- 一线工程师导入客户评价和反馈 -->
    <div v-if="formKey==='ALTERCUSTOMERREVIEWFORM'">
      <AlterCustomerReviewForm v-if="!viewType" :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
      <AlterCustomerReviewViewForm v-else :task-id="taskId" :work-order-num="workOrderNum" v-on="$listeners" />
    </div>

  </div>
</template>

<script>

import forms from '../mixin/forms.js'

export default {
  name: 'NewOrderForm',
  // 混入所有表单
  mixins: [forms],
  props: {
    workOrderNum: {
      required: false,
      type: String,
      default: 'NULL'
    },
    formKey: {
      reuqired: true,
      type: String,
      default: ''
    },
    viewType: {
      required: false,
      type: Boolean,
      default: false
    },
    taskId: {
      required: false,
      type: String,
      default: 'NULL'
    }
  }
}
</script>
